{literal}<script>
$(function()
{
    $('#wysiwyg').wysiwyg();
});
</script>{/literal}

<div class="add_category"><a href="/admin/pages/">Страницы</a> &rarr; Добавить страницу</div>

<form action="/admin/pages/go/" method="post" enctype="multipart/form-data">
	<input name="id" type="hidden" value="{$parent_id}" />
    <input type="hidden" name="type" value="add" />
	<div id="content">
			<div id="inner">
			<table cellspacing="0" cellpadding="4">
				<tbody class="edit">
                    <tr>
						<th width="200px">На страницу</th>
						<td>
                        <select name="parent_id">
                        {foreach from=$pages item=doc}
                            <option value="{$doc.id}" {if $parent_id == $doc.id}selected{/if}>{$doc.name}</option>
							{if $doc.parent}
							{foreach from=$doc.parent item=doc}
                            <option value="{$doc.id}" {if $parent_id == $doc.id}selected{/if}>---{$doc.name}</option>
								{if $doc.parent}
								{foreach from=$doc.parent item=doc}
								<option value="{$doc.id}" {if $parent_id == $doc.id}selected{/if}>------{$doc.name}</option>
								{/foreach}
								{/if}
							{/foreach}
							{/if}
            			{/foreach}
						</select>

                        </td>
					</tr>
					<tr>
						<th width="200px">Название страницы</th>
						<td><input type="text" name="name" /></td>
					</tr>
					<tr>
						<th width="200px">Slug(без пробелов, на англиском языке)</th>
						<td><input type="text" name="slug" /></td>
					</tr>
					<tr>
						<th width="200px">Описание</th>
						<td><textarea name="description" id="wysiwyg"></textarea></td>
					</tr>
				</tbody>
			</table>
			</div>
	</div>
	<br />
	<input type="submit" value="Сохранить" />
</form>
